package com.znsd.zl.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.znsd.zl.order.entity.OrderEntity;
import com.znsd.zl.order.entity.vo.HouseRentVo;
import com.znsd.zl.order.entity.vo.OrderEntityVo;
import com.znsd.zl.order.entity.vo.UserOrderVo;
import com.znsd.zl.utils.PageUtils;

import java.util.List;
import java.util.Map;

/**
 * @ClassName OrderService
 * @Description 订单业务层接口
 * @author jaypdd
 * @email jaypdd@163.com
 * @date 2020-08-16 21:16:34
 * @Version v1.0
 */
public interface IOrderService extends IService<OrderEntity> {

    /**
     * 分页条件查询
     * @param pageNum
     * @param pageSize
     * @param params
     * @return
     */
    PageUtils queryPage(Integer pageNum, Integer pageSize, Map<String, Object> params);

    /**
     * 查询所有订单
     * @param pageNum
     * @param pageSize
     * @param params
     * @return
     */
    PageUtils findAllOrder(Integer pageNum, Integer pageSize,Map<String, Object> params);

    /**
     * 查询所有订单App
     * @param id
     * @return
     */
    PageUtils findAllTradeOrder(OrderEntity id);

    /**
     * 添加订单
     * @param orderEntity
     * @return
     */
    boolean saveOrder(OrderEntity orderEntity);

    /**
     * 逻辑删除
     * @param ids
     * @return
     */
    boolean setIsDelete(List<Integer> ids);

    /**
     * 把订单状态改为已完成
     * @param orderId
     */
    boolean setStatusSuccess (Integer orderId);

    /**
     * 把订单状态改为取消
     * @param orderId
     * @return
     */
    boolean setStatusCancel(Integer orderId);


    /**
     * 查看用户的租赁
     * @param userId
     * @return
     */
    List<HouseRentVo> findHouseRent(Integer userId);


    /**
     * 根据订单获取租房记录
     * @param rentId
     * @param page
     * @param limit
     * @return
     */
    List<UserOrderVo> orderRent(Integer rentId,Integer page,Integer limit);

    /**
     *  下单
     * @param orderEntity 存储订单
     * @param status     支付状态
     * @return
     */
     String placeAnOrder( OrderEntityVo orderEntity,  Boolean status);

}

